package com.rightsidetech.mall.mapper;


import com.rightsidetech.mall.dto.response.CommoditySpescResp;
import com.rightsidetech.mall.dto.response.userApp.OptCommodityResp;
import com.rightsidetech.mall.entity.MallCommoditySpecs;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MallCommoditySpecsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MallCommoditySpecs record);

    int insertSelective(MallCommoditySpecs record);

    MallCommoditySpecs selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MallCommoditySpecs record);

    int updateByPrimaryKey(MallCommoditySpecs record);

    int deleteByCommodityId(Long id);

    List<BigDecimal> selectPriceByCommodityId(Long commodityId);

    OptCommodityResp selectInNewByCommodityAndSpecsIds(@Param("commodityId") Long commodityId,@Param("specs") String specs);

    OptCommodityResp selectByCommodityAndSpecsIds(@Param("commodityId") Long commodityId,@Param("specs") String specs);

    MallCommoditySpecs selectSpecsByCommodityAndBarCode(@Param("commodityId") Long commodityId,@Param("barCode") String barCode);

    MallCommoditySpecs selectSpecsByCommodityAndspecs(@Param("commodityId") Long commodityId,@Param("specs") String specs);

    List<String> selectSpecsByCommodityId(Long commodityId);

    List<CommoditySpescResp> selectSpecsAndCode(Long commodityId);
}